<script type="text/javascript" src="/extra/fckeditor/fckeditor.js"></script>
<?php
echo $this->adminToolBar('specialtext', 'add', '/admin/specialtext/doaddspecialtext/', '/admin/specialtext/edit/', '/admin/specialtext/delete/', '/admin/specialtext/index/');
?>
<table border="1" width="100%" cellpadding="1" cellspacing="2">
	<tr>
		<td width="15%">Parent ID</td>
		<td width="85%">
                    <select name="parentid" id="parentid" class="input-2" >
                         <option value="0">--select--</option>
                        <?php foreach($this->tpl_arr as $arr):?>
                        <option value="<?php echo $arr["id"]; ?>"><?php echo  $arr["id"]."-". $arr["title"];?></option>
                        <?php endforeach;?>

                    </select>



                 
	</tr>
	<tr>
		<td width="15%">specialtext Title(English)</td>
		<td width="85%"><input type="text" name="title" id="title" value="" class="input-2" /></td>
	</tr>
        <tr>
		<td width="15%">specialtext Title (Russian)</td>
		<td width="85%"><input type="text" name="title_ru" id="title_ru" value="" class="input-2" /></td>
	</tr>
	<tr>
		<td>specialtext Content (English)</td>
		<td><?php echo $this->EditorFck('description'); ?></td>
	</tr>
	<tr>
		<td>specialtext Content (Russian)</td>
		<td><?php echo $this->EditorFck('description_ru'); ?></td>
	</tr>
	<tr>
		<td>Status</td>
		<td>
			<select name="status" id="status" class="input-2">
				<option value="">Select Status</option>
				<option value="1">Published</option>
				<option value="0">Unpublished</option>
			</select>
		</td>
	</tr>
</table>
<script type="text/javascript">
function savespecialtext() 
{
       var parentid=$('#parentid');
       var title=$('#title');
       var title_ru=$('#title_ru');
       var description = FCKeditorAPI.GetInstance("description").EditorWindow.parent.FCK.GetHTML();
       var description_ru = FCKeditorAPI.GetInstance("description_ru").EditorWindow.parent.FCK.GetHTML();
       var status=$('#status');
        if($('#active').attr('checked')==true)
            {
                active=1;

            }
            else{
                active=0;
            }
		$.ajax({
			type: "POST",
			url: '/admin/specialtext/doadd/',
			data: ({title:title.val(),title_ru:title_ru.val(),description:description,description_ru:description_ru,status:status.val(),parentid:parentid.val()}),
	    	        success: function(data, textStatus, XMLHttpRequest){
	    	   	if(data != '') {
                               alert(data);
                             //  alert("successfully Added the   features");
	    			loadPage('/admin/specialtext/');
	    	   	}
	    	},
	    	complete: function complete(XMLHttpRequest, textStatus){
	         //   $("#loader_area").hide();
	        }
		});

}


function deletestructurefield(id,rateid,hotelid)
{
		$.ajax({
			type: "POST",
			url: '/admin/rates/deletestructuredata/',
			data: ({id:id}),
	    	        success: function(data, textStatus, XMLHttpRequest){
	    	   	if(data != '') {
                               alert(data);
                             //  alert("successfully Added the   features");
	    			loadPage('/admin/rates/ratefeatures/rate_id/'+rateid+'/hotelid/'+hotelid);
	    	   	}
	    	},
	    	complete: function complete(XMLHttpRequest, textStatus){
	            $("#loader_area").hide();
	        }
		});

}

</script>


